<?php

class Challenge {

    private $Id;
    private $IdCategory;
    private $IdAuthor;
    private $Title;
    private $Description;
    private $Date;
    private $SolutionKey;
    private $FilePath;

    public function getId() {
        if (!isset($this->Id))
            $this->setId(0);
        return $this->Id;
    }

    public function setId($id) {
        $this->Id = $id;
    }

    public function IsPersited() {
        return $this->getId() != 0;
    }

    public function getIdCategory() {
        if (!isset($this->IdCategory))
            $this->setIdCategory(0);
        return $this->IdCategory;
    }

    public function setIdCategory($idCategory) {
        $this->IdCategory = $idCategory;
    }

    public function getIdAuthor() {
        if (!isset($this->IdAuthor))
            $this->setIdAuthor(0);
        return $this->IdAuthor;
    }

    public function setIdAuthor($idAuthor) {
        $this->IdAuthor = $idAuthor;
    }

    public function getTitle() {
        if (!isset($this->Title))
            $this->setTitle('');
        return $this->Title;
    }

    public function setTitle($title) {
        $this->Title = $title;
    }

    public function getDescription() {
        if (!isset($this->Description))
            $this->setDescription('');
        return $this->Description;
    }

    public function setDescription($description) {
        $this->Description = $description;
    }

    public function getDate() {
        if (!isset($this->Date))
            $this->setDate(date("Y-m-d H:i:s"));
        return $this->Date;
    }

    public function setDate($date) {
        $this->Date = $date;
    }

    public function getSolutionKey() {
        if (!isset($this->SolutionKey))
            $this->setSolutionKey('');
        return $this->SolutionKey;
    }

    public function setSolutionKey($solutionKey) {
        $this->SolutionKey = $solutionKey;
    }

    public function getFilePath() {
        if (!isset($this->FilePath))
            $this->setFilePath('');
        return $this->FilePath;
    }

    public function setFilePath($filePath) {
        $this->FilePath = $filePath;
    }

}

?>